package com.wang.demo;

import com.wang.demo.test.WDJ;
import com.wang.di.JustDIApplication;
import com.wang.di.core.bean.BaseBean;
import com.wang.di.core.handler.AnnoHandler;
import com.wang.di.web.WebApplication;
import com.wang.di.web.anno.Controller;
import com.wang.di.web.anno.PostMapper;
import com.wang.di.web.bean.ControllerBean;

import java.lang.annotation.Annotation;
import java.util.HashMap;
import java.util.Map;

public class DIDemo {
    public static void main(String[] args) throws Exception {
        WebApplication app = new WebApplication();
        AnnoHandler handler = app.postMapperExecutor();
        Map<Class<? extends Annotation>, AnnoHandler<?>> handlerMap = new HashMap<>();
        handlerMap.put(PostMapper.class, handler);

        Map<Class<? extends Annotation>, Class<? extends BaseBean>> beanClzMap = new HashMap<>();
        beanClzMap.put(Controller.class, ControllerBean.class);


        JustDIApplication application = new JustDIApplication();
        application.start(DIDemo.class, beanClzMap, handlerMap);
        application.get(WDJ.class).lala();

//        app.start();
    }
}
